import Koa from 'koa';
import winston from 'winston';
import body from 'koa-bodyparser';
import ramlMiddleware from './middlewares/raml-middleware.js';
import proxyMiddleware from '../common/middlewares/proxy.js';

const app = new Koa();

// Body Parser
app.use(body());
// RAML Mocks
app.use(ramlMiddleware());
// 临时 Proxy 老版 API Designer
// app.use(proxyMiddleware({
//     host: 'http://localhost:8083',
//     map: path => {
//         winston.warn('@deprecated redirecting to:',
//             `http://localhost:8083${path}`);
//         return path;
//     }
// }));

export default app;
